﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Frontend.Master" AutoEventWireup="true" CodeBehind="cart.aspx.cs" Inherits="BabyShop.cart" %>
<%@ Import Namespace="System.Data" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div ><div class="nyroModalLink"><iframe style="display: none" src="/cart/tracking"></iframe>
<div id="three_step_checkout">
<div class="new_cart new_ajax_cart">
        <div data-role="message-holder">
            </div>
    <form method="post" action="/cart/" id="cart-items-list-form">
<div style="display:none"><input type="hidden" name="YII_CSRF_TOKEN" value="480c08ca918315476f2538efe4a938ed3f14da0b"></div>    <input type="hidden" value="1" name="cartUpdate">
    <span class="cartintro">Bạn có <%=dt.Rows.Count %> sản phẩm trong giỏ hàng</span>
    <table id="tableheader" class="width_100">
        <tbody><tr>
            <td class="width_20"></td>
            <td class="width_40"></td>
            <td class="width_15 center">Giá</td>
            <td class="width_10 center">Số lượng</td>
            <td class="width_20 right_align lastcolumn">Tổng cộng</td>
        </tr>
    </tbody></table>
    <div class="scrollable">
    <%
        if (dt.Rows.Count > 0)
        {
            double total = 0;
            foreach (DataRow item in dt.Rows)
            {
                total += (double)item["price"];
    %>
    <table class="width_100">
          <tbody><tr>
            <td class="width_20">
                <a href="/product.aspx?id=<%=item["id"] %>">
                    <img width="117" height="117" onerror="$(this).attr('src','/images/main/placeholder_l_1.jpg')" alt="<%=item["name"] %>" src="/images/product_images/<%=item["image_path"] %>">
                </a>
            </td>
            <td class="width_40">
                <div class="productdescription"><%=item["name"]%></div>
                <div class="productdetails"><%=item["brand_name"]%></div>
                        <span class="stock instock">✓ Còn hàng</span>
                                    <span class="productlink">                                
                            </span>
                                                        <span class="productlink">
                            <a class="cart-product-actions-link cartItemRemove sel-cart-remove-item-CO084TB73DVYANVN-57331" href="/cart?action=remove&id=<%=item["id"] %>">
                                Xóa                                    </a>
                        </span>
            </td>
            <td class="width_15 price center">
                <span><%=string.Format("{0:c0}", item["price"])%> VND</span><br>
                                            <span class="mbs cart-product-oldprice-value">
                                <span><%=string.Format("{0:c0}", (double)item["price"] + ((double)item["price"] * (int)item["sales"] / 100))%> VND</span>
                            </span><br>
                                                                    <span class="txtGreen strong">
                                Giảm giá <%=item["sales"]%>%                                    </span>
                                    </td>
            <td class="width_10 price center">1
               <!-- <select title="Số lượng" class="sel-cart-quantity-CO084TB73DVYANVN-57331 cart-product-actions-select cart-product-item-cell-qty-select">
                                <option selected="">1</option>
                                <option>2</option>
                                <option>3</option>
                                <option>4</option>
                                <option>5</option>
                        </select>-->
           </td>
            <td class="width_20 right_align price lastcolumn">                        
                <%=String.Format("{0:c0}",item["price"]) %> VND                        
                <div style="color:green"></div>
</td>
                </tr>
            </tbody></table>
    <%      
            } %>   
            </div>
    
    <div id="subtotal">
        <table class="width_100">
            <tbody>            
                        <tr class="total">
                <td class="width_15">Thành tiền</td>
                <td class="width_30 right_align lastcolumn">
                    <div><%=String.Format("{0:c0}",total) %> VND</div>
                    <div class="vatinclude">Đã bao gồm VAT</div>
                </td>
            </tr>
        </tbody></table>
    </div>
    <% } %>
            <div class="cart_btn_row">
            <div class="closelink">
                                    <a href="/" class="sel-continue-shopping" id="cartContinueShopping">
                        <span>► Tiếp tục mua sắm</span>
                    </a>
                            </div>
            <div class="proceedtocheckout">
                                <a href="/checkout" class="submit_btn mtssel-cart-checkout-button">
                    <span class="cart_submit_text">Tiến hành thanh toán</span>
                    <span class="cart_submit_icon"></span>
                </a>
            </div>
        </div>
        </form></div>
</div>
</div></div>
</asp:Content>
